<?php
use yii\helpers\Html;
use yii\helpers\Url;

use common\models\MktPost;
use common\models\MktPostComplain;

?>
<!--
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="keywords" content="首页关键字" />
  <meta name="description" content="首页描述" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Cache-Control" content="no-cache" />
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=2.0" />
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  
  <link rel="stylesheet" href="resources/css/weui/weui.min.css">
  <link rel="stylesheet" href="resources/css/main.min.css">
  <link rel="stylesheet" href="resources/css/man.min.css">
  
  <script src="resources/js/jquery-1.10.min.js"></script>
  <script src="resources/js/jquery.touchSwipe.min.js"></script>
  <script src="resources/js/frmwebm.min.js"></script>
  <title>投诉</title>
  <style>
  .weui_media_hd{
    text-align: top;
    margin-top: -30px;
	font-size:28px;
  }
  .weui_media_hd .month{
	font-size:12px;
  }
  .weui_cells {
    font-size: 15px;
  }
  .weui_cells_title{
	color:#8a898e;
  }
  .weui_cells {
    margin-top: 10px;
  }
  </style>
</head>
<body style="background: #F1F0F5 none repeat scroll 0 0;">
-->
<?php $this->params['backgroundColor'] = "#F1F0F5"; ?>
<?php $this->title = "投诉"; ?>
<?php
$css = <<<EOD
  .weui_media_hd{
    text-align: top;
    margin-top: -30px;
	font-size:28px;
  }
  .weui_media_hd .month{
	font-size:12px;
  }
  .weui_cells {
    font-size: 15px;
  }
  .weui_cells_title{
	color:#8a898e;
  }
  .weui_cells {
    margin-top: 10px;
  }
EOD;
     $this->registerCss($css);
?>

	<div class="weui_cells_title">请选择投诉原因</div>
	<form id="form">
	<div class="weui_cells weui_cells_radio">

        <?php foreach(MktPostComplain::getPostComplainOption() as $value => $label) { ?>
        <label for="s<?php echo $value ?>" class="weui_cell weui_check_label">
            <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                <p><?php echo $label ?></p>
            </div>
            <div class="weui_cell_hd">
                <input type="radio" value="<?= $value ?>" checked="checked" id="s<?php echo $value ?>" name="checkbox1" class="weui_check">
                <span class="weui_icon_checked"></span>
            </div>
        </label>
        <?php } ?>

    </div>
    </form>
	
	<div class="weui_msg">
		<div class="weui_opr_area">
			<p class="weui_btn_area">
				<a  onclick="addTouSu(); return false;" href="#" class="weui_btn weui_btn_primary">完成</a>
			</p>
		</div>
	</div>
<script type="text/javascript">
function create()
{
	frmwebm.toast('投诉成功', 2000);
	setTimeout(function ()
	{
		window.location.href = "detail.jsp";
	}, 2000);
}


function addTouSu() {
    var jumpUrl = "<?php echo $this->context->getMe()->getJump() ?>";
    if (jumpUrl.length)
    {
        window.location.href = jumpUrl;
        return false;
    }

	var args = {
		'classname': '\\common\\models\\MktPostComplain',
		'funcname': 'insertAjax',
		'params': {
			'user_id' : <?php echo \common\wosotech\Util::getSessionUserId(); ?>,
			'post_id': <?php echo $model->id; ?>,
                     'reason':  $('input:radio[name="checkbox1"]:checked').val()
		}
	};

	frmwebm.confirm({
		title:"投诉",
		content:"确认投诉此贴?",
		url: "<?= Url::to(['/wap/ajax-broker']); ?>",
		type: "GET",
		data: "args=" + JSON.stringify(args),
		successFunc: function (resp) {
			if (resp['code'] != 0) {
				frmwebm.prompt({
					title: "友情提示",
					content: resp['data']
				});
				return;
			}

                    frmwebm.toast('投诉成功', 2000);
                    setTimeout(function () {
                        parent.history.back();
                    }, 2000);
			
		},
		errorFunc: function () {
			//alert('send error');
		},
		//reload: true
		//afterClose: null,
	});
}

</script>

<!--
</body>
</html>
-->
<?php
/*
        <label for="s11" class="weui_cell weui_check_label">
            <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                <p>欺诈</p>
            </div>
            <div class="weui_cell_hd">
                <input type="radio" checked="checked" id="s11" name="checkbox1" class="weui_check">
                <span class="weui_icon_checked"></span>
            </div>
        </label>

        <label for="s12" class="weui_cell weui_check_label">
            <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                <p>广告骚扰</p>
            </div>
            <div class="weui_cell_hd">
                <input type="radio" id="s12" class="weui_check" name="checkbox1">
                <span class="weui_icon_checked"></span>
            </div>
        </label>
        <label for="s13" class="weui_cell weui_check_label">
            <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                <p>恶意营销</p>
            </div>
            <div class="weui_cell_hd">
                <input type="radio" id="s13" class="weui_check" name="checkbox1">
                <span class="weui_icon_checked"></span>
            </div>
        </label>
        <label for="s14" class="weui_cell weui_check_label">
            <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                <p>隐私信息收集</p>
            </div>
            <div class="weui_cell_hd">
                <input type="radio" id="s14" class="weui_check" name="checkbox1">
                <i class="weui_icon_checked"></i>
            </div>
        </label>
        <label for="s15" class="weui_cell weui_check_label">
            <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                <p>侵权类（冒名、诽谤、抄袭）</p>
            </div>
            <div class="weui_cell_hd">
                <input type="radio" id="s15" class="weui_check" name="checkbox1">
                <i class="weui_icon_checked"></i>
            </div>
        </label>

*/
